﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Toolkit.Web.ExtensionMethods;

namespace Toolkit.Web.ViewComponents.Panel
{
    public static class PanelExtensions
    {
        public static PanelBuilder Panel(this ViewComponentFactory viewComponentFactory)
        {
            return Panel(viewComponentFactory, null);
        }

        public static PanelBuilder Panel(this ViewComponentFactory viewComponentFactory, object htmlAttributes)
        {
            Panel panel = new Panel(viewComponentFactory.Writer);

            if (htmlAttributes != null)
            {
                panel.HtmlAttributes.Merge(htmlAttributes, true);
            }

            return new PanelBuilder(panel);
        }
    }
}
